<!DOCTYPE html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
    <style type="text/css">
        body,
        html,
        #container {
            height: 100%;
            margin: 0px;
        }
    </style>
    <title>地图找房</title>
</head>

<body>
    <div id="container" tabindex="0"></div>
    <script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=f4a5386de1a049c7242c8c2a0a667bdd"></script>
    <script src="js/jquery.min.js" type="text/javascript"></script>
    <!--<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js" type="text/javascript"></script>-->
    <script src="js/template.js" type="text/javascript"></script>
    <script src="js/base.js" type="text/javascript"></script>
    <script type="text/javascript">
        var map = new AMap.Map('container', {
            resizeEnable: true,
            zoom: 12,
            center: [104.06, 30.64],
        });

        bee.request({
            url: '/Index/Index/getneighbourhood',
            data: null,
            success: function(data) {
                map.clearMap(); // 清除地图覆盖物
                for (var i = 0; data.list[i]; i++) {
                    var mar = new AMap.Marker({
                        map: map,
                        icon: new AMap.Icon({
                            size: new AMap.Size(24, 24), //图标大小
                            image: "image/icon.png",
                            imageSize: new AMap.Size(175, 224),
                            imageOffset: new AMap.Pixel(-10, -130)
                        }),
                        position: [data.list[i].lng, data.list[i].lat],
                        housing_id: data.list[i].housing_id,
                        offset: new AMap.Pixel(-12, -36)
                    });
                    mar.setLabel({
                        offset: new AMap.Pixel(25, 0),
                        content: data.list[i].name
                    });
                    mar.on('click', function() {
                        bee.open('house.html', {
                            id: this.G.housing_id
                        });
                    });
                }
            }
        });

        $(function() {
//            bee.wxConfig(function() {
//                bee.hideAllNonBaseMenuItem();
//            }, function(res) {});
        });
    </script>
</body>

</html>
